package 多线程;

/**
 * @Author 廖述京
 * @Date 2017/9/3
 */
public class StopAThreadTest{
    public static void main(String[] args) {
        //启动线程
        StopAThread stopAThread = new StopAThread();
        stopAThread.start();
        //等待3s，再停止线程
        /*
        long start = System.currentTimeMillis();
        long end;
        long time_3s=3_000;//3000毫秒
        while(((end=System.currentTimeMillis())-start)<time_3s){
//            System.out.println(end-start);
        } */
        //停止线程
        System.out.println("准备停止线程...");
        stopAThread.bExit=true;
    }
}
